OpenWGA 7.6 - WebTML reference

WebTML tags » [All tags]

<tml:[All tags] if ="itemexpression">

Purpose:

If the (any) condition in the if Item-Expression is false the tag is not rendered.

Description:

Attribute "if" receives a "boolean item expression" which tests WebTML items and calculates a boolean result. Its expression must return true for the tag to be rendered, otherwise it is cancelled.

The "unless" expression has priority over the "if" expression. When both are present and evaluate true then the tag is cancelled.

Boolean item expression

A simple expression syntax to use WebTML items for evaluating a boolean result. Consisting of:

  • Item term: Just anything that is valid in this.item() as item name, like names of content items, WebTML variables, Renderer/Controller property expressions
  • Boolean Operators: & being and, | being or, between those item terms. There may be only one type of boolean operator on one expression, so "a | b", "a & b & c" is valid, "a | b & c" is invalid.
  • Brackets to form sub expressions, where again a single boolean operator can be used, differing from the one on the main expression: "(a | b) & c"
  • Exclamation mark operators to negate either item expressions or sub expressions: "!a", "!(a & b)"

Every item term is evaluated for its boolean value by the rules of TMLContext.isTrue(). Then the boolean values are combined in the ways determined by operators to form a result value.

Value(s):

Item expression

Examples:

<tml:input name="product" if="products_available"/>